package org.jactao.rpc;

import org.jactao.remote.netty.NettyServer;

import java.net.InetSocketAddress;

/**
 * Created by fanzetao on 2018/4/3.
 */
public abstract class LAbstractServer implements LServer {

    public LAbstractServer() {
    }

    private InetSocketAddress bindAddress;

    private String serializer;

    public void setBindAddress(InetSocketAddress bindAddress) {
        this.bindAddress = bindAddress;
    }

    public InetSocketAddress getBindAddress() {
        return bindAddress;
    }

    public String getSerializer() {
        return serializer;
    }

    public void setSerializer(String serializer) {
        this.serializer = serializer;
    }

    public static LAbstractServer get(String protocolName) {
        switch (protocolName) {
            case "netty":
                return new NettyServer();
            case "grizzly":
                return null;
            default:
                return null;
        }
    }
}
